//
//  FLAutoScollView.h
//  BaseRepo
//
//  Created by leo on 2018/8/9.
//  Copyright © 2018年 LEO. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FLView.h"
@class FLAutoScollViewCell;

@protocol FLAutoScollViewDelegate <NSObject>

@optional
//自己注册cell类型需要返回对应的cell
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView indexPathForCell:(NSIndexPath *)indexPath;

/**
 选中某个图片

 @param index 对应图片的位置索引
 */
- (void)autoScrollViewDidSelectedItemAtIndex:(NSInteger)index;


@end


@interface FLAutoScollView : FLView

///必须是UIColletionViewCell类型
@property (nonatomic, assign) Class registerClass;
@property (nonatomic, weak) id<FLAutoScollViewDelegate>delegate;
///是否无限滑动
@property (nonatomic, assign) BOOL loop;
///图片数组 (可以是NSSting<图片的url> 或者是 model, 如果是model类型那么需要自己注册cell)
@property (nonatomic, copy) NSArray *imageArray;
///是否隐藏分页控件
@property (nonatomic, assign) BOOL hiddenPageControl;
///分页控件选中的颜色
@property (nonatomic, strong) UIColor *colorForSelectPage;
///默认分页控件的颜色
@property (nonatomic, strong) UIColor *defaulColorForPage;
///自动滚动的时间间隔 默认为3秒
@property (nonatomic, assign) NSTimeInterval autoScrollTimeInterval;
///是否自动滚动
@property (nonatomic, assign) BOOL isAutoScroll;
///自定义展位图
@property (nonatomic, strong) UIImage *placeHolderImage;

/**
设置属性必须在调用之前（必须在最后调用)
 */
- (void)refreshScrollView;

@end
